package com.yc.hotel.service.impl;

import java.util.List;

import java.util.Map;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import com.yc.hotel.dto.UserInfoDTO;
import com.yc.hotel.entity.UserInfo;
import com.yc.hotel.mapper.IUserInfoMapper;
import com.yc.hotel.service.IUserInfoService;
import com.yc.hotel.util.StringUtil;

@Service
public class UserInfoServiceImpl implements IUserInfoService {

	@Autowired
	private IUserInfoMapper userInfoMapper;
	
	@Override
	public int reg(UserInfo uf) {
		if(StringUtil.checkNull(uf)) {
			return -1;
		}
		return userInfoMapper.reg(uf);
	}

	@Override
	public UserInfo login(Map<String, Object> map) {
		if(StringUtil.checkNull(map)) {
			return null;
		}
		return userInfoMapper.login(map);
	}

	@Override
	public List<UserInfo> findByPage(Map<String, Object> map) {
		if(StringUtil.checkNull(map)) {
			return null;
		}
		return null;
	}

	@Override
	public int total(Map<String, Object> map) {

		return 0;
	}

	@Override
	public int updateStatus(Map<String, Object> map) {
		if(StringUtil.checkNull(map)) {
			return -1;
		}
		return 0;
	}

	@Override
	public int updatePwd(Map<String, Object> map) {
		if(StringUtil.checkNull(map)) {
			return -1;
		}
		return 0;
	}

	@Override
	public UserInfoDTO findByUno(int uno) {
		
		return userInfoMapper.findByUno(uno);
	}

}
